
<include file="Public:header" />
<div class="container main">
    <include file="Public:left" />
    <div class="w790">
        <div class="h">
            <a href="{:U('index')}" class="btn btn-info">
                <i class="glyphicon glyphicon-circle-arrow-left"></i> 返回用户列表
            </a>
        </div>
        <form class="checkoutform form-horizontal" action="{:U('update')}" method="post">
            <div class="table_ container">
                <input type="hidden" name="id" value="{$info.id}" >
                <div class="setting_table">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">登录名</label>
                        <div class="col-sm-10">
                            <input class="form-control" datatype="*" value="{$info.account}" name="account" type="text" placeholder="登录名">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">昵称</label>
                        <div class="col-sm-10">
                            <input class="form-control" datatype="*" value="{$info.nickname}" name="nickname" type="text" placeholder="昵称">
                        </div>
                    </div>
                    <!--<div class="form-group">-->
                        <!--<label class="col-sm-2 control-label">E-mail</label>-->
                        <!--<div class="col-sm-10">-->
                            <!--<input class="form-control" datatype="e" value="{$info.email}" name="email" type="text" placeholder="E-mail">-->
                        <!--</div>-->
                    <!--</div>-->
                    <div class="form-group">
                        <label class="col-sm-2 control-label">备注</label>
                        <div class="col-sm-10">
                            <textarea name="remark" class="form-control"></textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">所属分组</label>
                        <div class="col-sm-10">
                            <select class="form-control" name="role_id[]" size="15" multiple="multiple" id="role_id[]">
                                <volist name="role_list" id="vo">
                                    <option 
                                    <eq name="vo['user_id']" value="$info['id']">selected="selected"</eq>
                                     value="{$vo.id}">{$vo.name}
                                    </option>
                                </volist>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">状态</label>
                        <div class="col-sm-10">
                            <label class="checkbox-inline">
                                <input 
                                <eq name="info['status']" value="1">checked="checked"</eq>
                                name="status" type="radio" value="1" checked="checked" />
                                启用</label>
                            <label class="checkbox-inline">
                                <input type="radio" 
                                <eq name="info['status']" value="0">checked="checked"</eq>
                                name="status" value="0" />
                                禁用</label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">是否管理员</label>
                        <div class="col-sm-10">
                            <label class="checkbox-inline">
                                <input 
                                <eq name="info['isadministrator']" value="1">checked="checked"</eq>
                                type="radio" name="isadministrator" value="1" />
                                是</label>
                            <label class="checkbox-inline">
                                <input name="isadministrator" 
                                <eq name="info['isadministrator']" value="0">checked="checked"</eq>
                                type="radio" value="0" />
                                否</label>
                        </div>
                    </div><div class="form-group">
                        <label class="col-sm-2 control-label">允许匿名登录</label>
                        <div class="col-sm-10">
                            <label class="checkbox-inline">
                                <input 
                                <eq name="info['anonymous']" value="1">checked="checked"</eq>
                                type="radio" name="anonymous" value="1" />
                                是</label>
                            <label class="checkbox-inline">
                                <input name="anonymous" 
                                <eq name="info['anonymous']" value="0">checked="checked"</eq>
                                type="radio" value="0" />
                                否</label>
                        </div>
                    </div>
                </div>
            </div>
            <div class="pages">
                <button type="submit" class="btn btn-success">保存</button>
            </div>
        </form>
    </div>
    <div class="clear">
    </div>
</div>
<script>
function delSite(id){
	if(confirm('确定要删除该管理站点吗？')){
		$('#siteids'+id).remove();
		$('#sitetitles'+id).remove();
	}else{
		return false;
	}
}

function addSite(id,title){
	var ise = true;
	$("input[name='sitelist[]']").each(function(index, element) {
        if(id == $(this).val()){
			ise = false;
		} 
    });
	//alert('<a href="#">'+title+'</a><input type="hidden" name="sitelist[]" value="'+id+'" />');
	if(ise){
		$('#sitelists').append('<a href="javascript:;" onclick="delSite('+id+');" id="sitetitles'+id+'">'+title+'</a>&nbsp;&nbsp;<input id="siteids'+id+'" type="hidden" name="sitelist[]" value="'+id+'" />');
	}
}
function showSitelistBox(curElement){
	art.dialog.open('{:U('User/sitelist')}', {width: 400, height: 400,lock:true,title:'选择可管理站点'});
}
</script>
</body></html>